<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8" />
    <meta name="viewport" content="width = device-width , initial-scale = 1 , minimum-scale = 1 , maximum-scale = 1 , user-scalable = no">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" href="../../resource/css/bootstrap.min.css">
	<link rel="stylesheet" href="../../resource/css/common.css">
</head>
<body>
	<div id="header">
		<a class="nav-back">返回</a>
        登陆
		<a class="register-title" href="../register/registerIdentify.html?url=1">注册</a>
	</div>
	<div id="login-form">
		<div class="login-context">
			<label id="lb-phoneNumber" for="phoneNumber">账号</label>
			<input placeholder="请输入手机号" onchange="" name="phoneNumber" id="phoneNumber" maxlength="11" />
        </div>
        <div class="login-context psd">
            <label id="lb-password" for="password">密码</label>
            <input type="password"  placeholder="请输入密码" onchange="" name="password" id="password" maxlength="20"/>
        </div>
        <div class="login-f-psd"><a class="f-psd" onclick="findMyPsd()">忘记密码？</a></div>
        <button type="submit" onclick="login()" name="btn-submit" class="btn-submit">登 陆</button>
    </div>
	<div id="footer">
		<div class="title-content">
			<h5 class="footer-title">使用合作伙伴账号登录</h5>
		</div>
		<div class="partner-content">
			<ul>
				<li>
					<a class="partner-icon tt" href=""></a>
				</li>
				<li>
					<a class="partner-icon wc" href=""></a>
				</li>
				<li>
					<a class="partner-icon si" href=""></a>
				</li>
			</ul>
		</div>
	</div>
    <!--   模态弹窗-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">

                <div class="modal-body">

                </div>

            </div>
        </div>
    </div>


	<script src="../../resource/js/jquery.min.js"></script>
	<script src="../../resource/js/bootstrap.min.js"></script>
    <script src="../../resource/js/commonjs.js"></script>
	<script type="text/javascript">
        $(function() {
            $(window).bind("resize", resizeWindow);
            autoLogin();
            $(".nav-back").click(function(){
                window.location.href = "../../index.html?url="+Math.random();
            })
        });
        function findMyPsd() {
            location.href = "../register/registerIdentify.html?newPsd=1";
        }
        function autoLogin() {
            var token = getCookie("token");
            if(token&&token != -1 && token.length > 1) {
                location.href = "../../index.html?url=1";
            }
        }
        function login() {
            checkData();
            var mobile = $('#phoneNumber').val();
            var password = $("#password").val();
            var url = "/Account/login";
            var arg = {};
            arg.mobile = mobile;
            arg.password = password;
            ajaxJsonp(url, arg, loginSuc);
        }
        function checkData() {
            if(!$('#phoneNumber').val()) {
                $('.modal-body').text("请输入账号");
                $('#myModal').modal();
                return false;
            }
            if(!$('#password').val()) {
                $('.modal-body').text("请输入密码");
                $('#myModal').modal();
                return false;
            }
        }
        /* 登录成功 */
        function loginSuc(res) {
            var msg = "登录中...."
            showModal(msg);
            var phone = $("#phoneNumber").val();
            var psd = $("#password").val();
            saveCookie("token", res.data.token, 20, "path=/");
            var url = "../../index.html?url=1";
            doJump(url);
        }
        /* 安卓手机键盘监听事件 */
        function resizeWindow(e) {
            $("#footer").toggle();
            var newWindowHeight = $(window).height();
        }
	</script>
</body>
</html>